import request from '@/utils/request'

// 查询学生试卷答案列表
export function listAnswer(query) {
  return request({
    url: '/exam/answer/list',
    method: 'get',
    params: query
  })
}

export function unDispatchStuList(examPaperId) {
  return request({
    url: '/exam/answer/unDispatchStuList',
    method: 'get',
    params: {
      examPaperId: examPaperId
    }
  })
}

// 查询当前用户的考试列表
export function getCurrentUserExam() {
  return request({
    url: '/exam/answer/user',
    method: 'get'
  })
}


// 查询学生试卷答案详细
export function getAnswer(id) {
  return request({
    url: '/exam/answer/' + id,
    method: 'get'
  })
}

// 新增学生试卷答案
export function addAnswer(data) {
  return request({
    url: '/exam/answer',
    method: 'post',
    data: data
  })
}

// 批量分发试卷
export function addAnswerBatch(data) {
  return request({
    url: '/exam/answer/batch',
    method: 'post',
    data: data
  })
}

// 修改学生试卷答案
export function updateAnswer(data) {
  return request({
    url: '/exam/answer',
    method: 'put',
    data: data
  })
}

// 删除学生试卷答案
export function delAnswer(id) {
  return request({
    url: '/exam/answer/' + id,
    method: 'delete'
  })
}
